<?php
/**
 * Created by PhpStorm.
 * User: TS
 * Date: 2017/4/4
 * Time: 20:24
 */
namespace core;

use core\http\Request;

class Router {


    public static function init()
    {
        $request = Request::getInstance();

        $url = preg_replace('/\.(' . ltrim('.html', '.') . ')$/i', '', $request->get('server.path_info', '', 'trim'));

        $mvc = Url::parseUrl($url);

        Request::getInstance()->controller($mvc['c']);
        Request::getInstance()->module($mvc['m']);
        Request::getInstance()->action($mvc['a']);
    }


}